import { isAliPay, isWeChat } from "./libs/const-ua";
import mini from "./libs/index";

export default platformObject => {
  if (!platformObject) {
    if (isWeChat) {
      console.warn("未传入微信jsdk对象，推荐使用script方式引入");
    } else {
      console.warn(
        "未传入支付宝window.my对象，请在html使用script方式引入https://appx/web-view.min.js"
      );
    }
  } else {
    return mini(() => {
      console.info("miniSDK success");
    }, platformObject);
  }
};
